/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package wumpus.gui;

import java.awt.GridLayout;
import javax.swing.JPanel;

/**
 *
 * @author dolalima
 */
public class Board extends JPanel{
    
    private int altura, largura;    
    Square[][] table;

    public Board(int largura, int altura) {
        super();
        this.altura = altura;
        this.largura = largura;
        GridLayout layout = new GridLayout(altura, largura);
        setLayout(layout);
        table = new Square[altura][largura];
        
        for(int i=0;i<altura;i++){
            for(int j=0;j<largura;j++){
                Square tile = new Square();
                table[i][j] =tile;
                add(tile);
            }
        }
        table[0][0].setUser(true);
        
        table[1][1].setType(SquareTypeEnum.HOLE);
        table[3][4].setType(SquareTypeEnum.HOLE);
        table[2][5].setType(SquareTypeEnum.HOLE);
        table[7][8].setType(SquareTypeEnum.HOLE);
        table[4][2].setType(SquareTypeEnum.HOLE);
        table[5][6].setType(SquareTypeEnum.WUMPUS);
        table[2][8].setType(SquareTypeEnum.CHEST);
        
    }
    
    
    
}
